#include "pch.h"
#include "CP3.h"
CP3::CP3(void)
{
	x = 0; y = 0; z = 0; w = 1;
}

CP3::~CP3(void)
{
}

CP3::CP3(double x, double y, double z)
{
	this->x = x;
	this->y = y;
	this->z = z;
}

CP3 operator+(const CP3& p0, const CP3& p1)
{
	CP3 temp;

	temp.x = p0.x + p1.x;
	temp.y = p0.y + p1.y;
	temp.z = p0.z + p1.z;
	temp.w = p0.w + p1.w;
	return temp;
}

CP3 operator-(const CP3& p0, const CP3& p1)
{
	CP3 temp;

	temp.x = p0.x - p1.x;
	temp.y = p0.y - p1.y;
	temp.z = p0.z - p1.z;
	temp.w = p0.w - p1.w;
	return temp;
}

CP3 operator*(const CP3& p, double scalar)
{
	CP3 temp;
	temp.x = p.x * scalar;
	temp.y = p.y * scalar;
	temp.z = p.z * scalar;
	temp.w = p.w * scalar;
	return temp;
}

CP3 operator*(double scalar, const CP3& p)
{
	CP3 temp;
	temp.x = p.x * scalar;
	temp.y = p.y * scalar;
	temp.z = p.z * scalar;
	temp.w = p.w * scalar;
	return temp;
}
